package com.zhongfl.crm.enums.boss;

import lombok.Getter;

/**
 * 消息发送类型
 * @author 木叶丸
 * @date 2018/5/25
 */
@Getter
public enum MessageSendMethod {

    WECHAT_TEMPLATE_MSG("1", "微信模板消息"),
    DINGDING_MSG("2", "钉钉消息"),
    QI_YE_WECHAT("3", "企业微信应用消息"),
    OTHER("0", "其他");

    private String key;
    private String value;

    MessageSendMethod(String key, String value) {
        this.key = key;
        this.value = value;
    }

    public static MessageSendMethod getEnumByKey(String key) {
        for (MessageSendMethod item : MessageSendMethod.values()) {
            if (item.getKey().equals(key)) {
                return item;
            }
        }
        return OTHER;
    }
}
